﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
	xmlns:local="clr-namespace:WeiTalk">
    
    <Style TargetType="local:WeiBoContent">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:WeiBoContent">
                    <Border BorderThickness="5"  CornerRadius="10" Background="#FFA14E08" Width="450" >
                        <Grid x:Name="LayoutRoot"  >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto"/>
                                <ColumnDefinition  Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="1"/>
                            </Grid.RowDefinitions>
                            <StackPanel Orientation="Horizontal" Grid.Column="0">
                                <TextBlock  TextWrapping="Wrap" Text="{TemplateBinding UserName}" HorizontalAlignment="Left"   Margin="5" x:Name="tbUserName"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
                                <TextBlock x:Name="tbCreateAt" TextWrapping="Wrap" Text="{TemplateBinding CreatedAt}"  Margin="5" VerticalAlignment="Top" HorizontalAlignment="Right" />
                            </StackPanel>
                            <Grid Grid.Row="1" Grid.ColumnSpan="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="65"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="auto"/>
                                    <RowDefinition Height="auto"/>
                                </Grid.RowDefinitions>
                                <Image Width="50" Height="50" VerticalAlignment="Top" x:Name="headImg" Grid.Column="0" HorizontalAlignment="Left" Margin="7,0,0,0" Stretch="UniformToFill" Source="{TemplateBinding ProfileImageUrl}"/>
                                <StackPanel Orientation="Vertical" Grid.Column="1" HorizontalAlignment="Left" x:Name="spContent">
                                    <TextBlock x:Name="tbContent" TextWrapping="Wrap" Text="{TemplateBinding Text}" Margin="15,2,5,10" VerticalAlignment="Top"  HorizontalAlignment="Left" Foreground="#FFFDFDFD" />
                                </StackPanel>
                                <Image x:Name="imgWeiBo" Width="150" Height="150" Grid.Row="1" Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="0,5" Stretch="None" Source="{TemplateBinding ThumbnailPic}" Visibility="{TemplateBinding ThumbnailPicVisibility}"/>
                            </Grid>
                            <StackPanel Grid.Row="2" Grid.ColumnSpan="2" x:Name="spRetweeted"  Visibility="{TemplateBinding RetweetedVisibility}">
                                <Border BorderThickness="3,8,5,8" CornerRadius="7" Margin="60,0,0,0" Background="#B2874014">
                                    <Grid x:Name="RetweetedGrid" Margin="5,2">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="auto"/>
                                            <RowDefinition Height="*"/>
                                            <RowDefinition Height="*"/>
                                            <RowDefinition Height="auto"/>
                                        </Grid.RowDefinitions>
                                        <StackPanel Orientation="Horizontal" Grid.Column="0" Grid.ColumnSpan="2">
                                            <TextBlock  TextWrapping="Wrap" Text="{TemplateBinding RetweetedUserName}" HorizontalAlignment="Left"   Margin="5" x:Name="tbRetweetedUserName" FontSize="18.667" Foreground="#FFBEB1B1" />
                                        </StackPanel>
                                        <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
                                            <TextBlock x:Name="tbRetweetedCreateAt" TextWrapping="Wrap" Text="{TemplateBinding RetweetedCreateAt}"  Margin="5" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="18.667" Foreground="#FFBEB1B1" />
                                        </StackPanel>

                                        <StackPanel Orientation="Vertical" HorizontalAlignment="Left" Grid.Row="1">
                                            <TextBlock  TextWrapping="Wrap" Text="{TemplateBinding RetweetedContent}" VerticalAlignment="Top"   HorizontalAlignment="Left" x:Name="tbRetweetedContent" Margin="15,2,5,0" Foreground="#FFBEB1B1" />
                                        </StackPanel>
                                        <Image x:Name="imgRetweetedWeiBo" Width="120" Height="120" Grid.Row="2"  HorizontalAlignment="Center" Margin="0,5" Stretch="None" Source="{TemplateBinding RetweetedThumbnailPic}" Visibility="{TemplateBinding RetweetedWeiBoVisibility}"/>
                                        <StackPanel Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Orientation="Horizontal">
                                            <TextBlock  TextWrapping="Wrap" Text="{TemplateBinding RetweetedSource}" HorizontalAlignment="Left"   Margin="10,10,5,5" x:Name="tbRetweetedSource"  Foreground="#FFC49472" FontSize="16"/>
                                        </StackPanel>
                                        <StackPanel  VerticalAlignment="Bottom" HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="2" >
                                            <TextBlock  TextWrapping="Wrap"   HorizontalAlignment="Right" Margin="10,10,5,5" x:Name="tbRetweetedRepostsCount"  Foreground="#FFC49472" FontSize="13.333" />
                                            <TextBlock  TextWrapping="Wrap" Text="{TemplateBinding RetweetedCommentCount}" HorizontalAlignment="Right"   Margin="20,5,5,5" x:Name="tbRetweetedCommentsCount"  Foreground="#FFC49472" FontSize="13.333" VerticalAlignment="Bottom"/>
                                        </StackPanel>
                                    </Grid>
                                </Border>
                            </StackPanel>

                            <TextBlock  TextWrapping="Wrap" Text="{TemplateBinding Source}" HorizontalAlignment="Left"  Margin="20,5,5,5" x:Name="tbSource"  Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Foreground="#FFC49472" FontSize="16"/>
                            <StackPanel Grid.Column="1"  Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right">
                                <TextBlock  TextWrapping="Wrap"  HorizontalAlignment="Right"   Margin="20,5,5,5" x:Name="tbRepostsCount" Foreground="#FFC49472" FontSize="13.333" VerticalAlignment="Bottom"/>

                                <TextBlock  TextWrapping="Wrap"  HorizontalAlignment="Right"   Margin="20,5,5,5" x:Name="tbCommentsCount"  Foreground="#FFC49472" FontSize="13.333" VerticalAlignment="Bottom"/>
                            </StackPanel>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
